package com.pattern.design.Chapter_4.com.devchronicles.singleton;

public class MySingleton5 {

	private static volatile MySingleton5 instance;

	private MySingleton5() {
	}

	public static MySingleton5 getInstance() {
		if (instance == null) { // 1
			synchronized (MySingleton5.class) {
				if (instance == null) { // 2
					instance = new MySingleton5();
				}
			}
		}
		return instance;
	}
}
